package 对称之美;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        while (T-- > 0) {
            int n = in.nextInt();
            boolean[][] hash = new boolean[n][26];
            for (int i = 0; i < n; i++) {
                String s = in.next();
                for (int j = 0; j < s.length(); j++) {
                    hash[i][s.charAt(j) - 'a'] = true;
                }
            }
            int i = 0, j = n - 1, flag = 1;
            while (i < j) {
                if (!fun(hash, i, j)) {
                    flag = 0;
                    break;
                }
                i++;
                j--;
            }
            if (flag == 1) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        }
    }

    private static boolean fun(boolean[][] hash, int i, int j) {
        for (int k = 0; k < 26; k++) {
            if (hash[i][k] && hash[j][k]) {
                return true;
            }
        }
        return false;
    }
}
